#ifndef PARSENIT_H_
#define PARSENIT_H_

#define NIT_DESCRIPTOR_MAX 1024
#define NIT_TRANSPORT_MAX 128

typedef struct TS_NIT_TRANSPORT
{
	unsigned transport_stream_id                    :16;
	unsigned original_network_id                    :16;
	unsigned reserved_future_use                    :4;
	unsigned transport_descriptors_length           :12;
	unsigned char descriptor[NIT_DESCRIPTOR_MAX];

} TS_NIT_TRANSPORT;

typedef struct TS_NIT
{
	unsigned table_id                        :8;
	unsigned section_syntax_indicator        :1;
	unsigned reserved_future_use_1           :1;
	unsigned reserved_1                      :2;
	unsigned section_length                  :12;
	unsigned network_id                      :16;
	unsigned reserved_2                      :2;
	unsigned version_number                  :5;
	unsigned current_next_indicator          :1;
	unsigned section_number                  :8;
	unsigned last_section_number             :8;
	unsigned reserved_future_use_2           :4;
	unsigned network_descriptors_length      :12;
	unsigned char network_descriptor[NIT_DESCRIPTOR_MAX];
	unsigned reserved_future_use_3           :4;
	unsigned transport_stream_loop_length    :12;

	TS_NIT_TRANSPORT astNIT_Transport[NIT_TRANSPORT_MAX];

	unsigned int CRC_32                          :32;

	struct TS_NIT *next; 
	struct TS_NIT *Previous;
} TS_NIT;

TS_NIT *TS_PackageNitPoint;
TS_NIT *NitPoint;

#endif